package com.telecom.cms.service;

import java.util.List;
import com.telecom.cms.dao.SysUserDAO;
import com.telecom.cms.dto.SysUser;
import com.telecom.cms.util.Constant;

public class SysUserMgr {
   
	public int save(SysUser sysuser){
		int result=(new SysUserDAO()).insert(sysuser);
		return result;
	}
	
	public void delete(SysUser sysuser){
		(new SysUserDAO()).delete(sysuser);
	}
	
	public List findall(){
		List result=(new SysUserDAO()).findAll();
		return result;
	}
	
	public List findall(String latnid){
		if (latnid.equals((new Constant()).getPara("PROVINCEID")))
			return findall();
		List result=(new SysUserDAO()).findAll(latnid);
		return result;
	}
	
	public List findallouter(String latnid){
		if (latnid.equals((new Constant()).getPara("PROVINCEID")))
			return findall();
		List result=(new SysUserDAO()).findAllOuter(latnid);
		return result;
	}
	
	public SysUser findById(String id){
		SysUser result=(new SysUserDAO()).findById(Integer.parseInt(id));
		return result;
	}
	
	public SysUser findById(String username,String passwd){
		SysUser result=(new SysUserDAO()).findById(username,passwd);
		return result;
	}
}
